<#import "/common/function.ftl" as fn>
<@fn.header _title="">
<script type="text/javascript" src="${base}/resources/script/jquery.pager.js"></script>
</@fn.header>
<script language="javascript">
function deleteRecord(id)
{
	if(confirm('删除操作可能影响已经发生的业务，确定要删除？'))
	{
		window.location.href = "delete?id=" + id;
	}
}
</script>
<body style="width:100%" class="list">
<form id="listForm" action="list" method="post">
	<h2><img src="${base}/resources/style/images/iconDivM.gif" width="16" height="16" />用户管理</h2>
	<div class="title marginTop15">
		<div class="title-middle">
			<div class="title-left"></div>
			<div class="title-caption">
				<label style="font-weight:bold;">姓名: </label>
				<input type="hidden" name="propertyList" value="username"/>
				<input type="hidden" name="compareTypeList" value="like"/>
				<input type="text" name="keywordList" value="${(pager.keywordList[0])!}" />
				<label style="font-weight:bold;">操作人: </label>
				<input type="hidden" name="propertyList" value="operator"/>
				<input type="hidden" name="compareTypeList" value="like"/>
				<input type="text" name="keywordList" value="${(pager.keywordList[1])!}" />
				<input type="submit" id="searchButton" class="button" value="搜 索" />
			</div>
            <div class="title-right">
            	<img src="${base}/resources/style/images/action_add.gif" width="16" height="16" /><a href="#" onclick="location.href='add'">添加用户</a>
            </div>
		</div>
	</div>
	<table class="table2" id="userListTable">
		<tr>
			<th>帐号</th>
			<th>姓名</th>
			<th>角色</th>
			<th>机构</th>
			<th>添加时间</th>
			<th>修改时间</th>
			<th>操作人</th>
			<th>操作</th>
		</tr>
		
		<#list pager.result as user>
		<tr>
			<td>
				${user.username}
			</td>
			<td>
				${user.name}
			</td>
			<td>
				<#list user.roles as role>
				${role.name};
				</#list>
			</td>
			<td>
				<#if !user.region?has_content> 未设置<#else>${user.region.name!}</#if>
			</td>
			<td>
				<span title="${user.createDate?string("yyyy-MM-dd HH:mm:ss")}">${user.createDate}</span>
			</td>
			<td>
				<span title="${user.modifyDate?string("yyyy-MM-dd HH:mm:ss")}">${user.modifyDate}</span>
			</td>
			<td>
				${user.operator}
			</td>
			<td>
				<a href="detail?id=${user.id}" title="详情">[详情]</a>
				<a href="edit?id=${user.id}" title="编辑">[编辑]</a>
				<a href="changepassword?id=${user.id}" title="修改密码">[修改密码]</a>
				<a onclick="deleteRecord('${user.id}')" style="cursor:pointer" title="删除">[删除]</a>
			</td>
		</tr>
		</#list>
	</table>
	<@fn.pagerCode />
</form>
</body>
</html>
